package com.tinyseed.emcp.api.basicdata.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/***
 * @ClassName: MonitorRstDataLatest
 * @Description: TODO
 * @Auther: Harlan.Xiong
 * @Date: 2019-12-29 15:58
 * @version : V1.0
 */
@Data
@Table(name = "tb_monitor_rst_data_latest")
@Entity()
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MonitorRstDataLatest implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 唯一主键
     */
    @Id
    @SequenceGenerator(name = "tb_monitor_rst_data_latest_sequence", sequenceName = "tb_monitor_rst_data_latest_sequence", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_monitor_rst_data_latest_sequence")
    private Long id;
    @Column(name = "switch_sn")
    private String switchSn; //网关序列号

    @Column(name = "switch_version")
    private String switchVersion; //网关版本号

    @Column(name = "switch_soft_version")
    private String switchSoftVersion; //网关软件版本号

    @Column(name = "device_sn")
    private String deviceSn; //生产或治污设备编码，业务中对应监测点

    @Column(name = "system_time")
    private Date systemTime; //系统时间

    @Column(name = "data_time")
    private Date dataTime;//数据采集时间

    @Column(name = "ia")
    private double ia; //A相电流

    @Column(name = "ib")
    private double ib; //B相电流

    @Column(name = "ic")
    private double ic; //C相电流

    @Column(name = "ua")
    private double ua; //A相电压

    @Column(name = "ub")
    private double ub; //B相电压

    @Column(name = "uc")
    private double uc; //C相电压

    @Column(name = "ta")
    private double ta; //A相温度

    @Column(name = "tb")
    private double tb; //B相温度

    @Column(name = "tc")
    private double tc; //C相温度

    @Column(name = "pkw")
    private double pkw;  //总有功率

    @Column(name = "qkw")
    private double qkw; //总无功率

    @Column(name = "the")
    private double the; //功率因数

    @Column(name = "pi")
    private double pi; //总有功电量

    @Column(name = "qi")
    private double qi; //总无功电量

    @Column(name = "max_i")
    private double maxI; //最大相电流

    @Column(name = "max_u")
    private double maxU; //最大相电压

    @Column(name = "create_time")
    private Timestamp createTime;//创建时间

    @Column(name = "equipment_status")
    private int equipmentStatus; //设备最新状态

    @Column(name = "reach_limit_kw_date")
    private Timestamp reachLimitKwDate; //数据达到功率启停阈值(kW)时间
}
